home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / mus / play / tracker_4_31.lzh / tracker / color.c < prev    next >
C/C++ Source or Header  |  1995-05-15  |  904b  |  52 lines

  1. /* color.c
  2.     vi:ts=3 sw=3:
  3. */
  4.  
  5. /* $Id: color.c,v 1.4 1995/05/11 12:23:36 espie Exp espie $
  6.  * $Log: color.c,v $
  7.  * Revision 1.4  1995/05/11  12:23:36  espie
  8.  * *** empty log message ***
  9.  *
  10.  * Revision 1.3  1995/03/08  13:48:44  espie
  11.  * *** empty log message ***
  12.  *
  13.  * Revision 1.2  1995/03/06  23:36:05  espie
  14.  * Proper color patch.
  15.  *
  16.  * Revision 1.1  1995/03/02  13:52:25  espie
  17.  * Initial revision
  18.  *
  19.  */
  20.  
  21. char *write_color(base, color)
  22. char *base;
  23. int color;
  24.     {
  25. #ifdef __OS2__
  26.     // The first 7 colors are totally useless
  27.     if(color>0)
  28.         color = color % 8 + 8;
  29. #endif
  30. #ifdef AMIGA
  31. #else
  32.     *base++ = '\033';
  33.     *base++ = '[';
  34. #ifdef SCO_ANSI_COLOR
  35.     if (color == 0)
  36.         {
  37.         *base++ = 'x';
  38.         return base;
  39.         }
  40. #endif
  41.     *base++ = '0' + color / 8;
  42.     *base++=';';
  43.     *base++='3';
  44.     if (color == 0)        /* color == 0 means reset */
  45.         *base++ = '9';
  46.     else
  47.         *base++ = '0' + color % 8;
  48.     *base++ = 'm';
  49. #endif
  50.     return base;
  51.     }
  52.